/*************************************************************************
	> File Name: oj-201_xiangkesi_randnum.c
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: 2020年10月27日 星期二 03时20分08秒
 ************************************************************************/

#include <stdio.h>

int main() {
    int n, x, cnt = 0, arr[1001] = {0}, ans[101] = {0};
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &x);
        if (!arr[x]) arr[x] = 1;
    }
    for (int i = 0; i < 1001; ++i) {
        if (arr[i]) {
            ans[cnt++] = i;
        }
    }
    printf("%d\n", cnt);
    for (int i = 0; i < cnt; ++i) {
        i && printf(" ");
        printf("%d", ans[i]);
    }
    return 0;
}
